<html>
<head><meta charset="utf-8"><title>__int128 · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html">__int128</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="172929326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172929326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172929326">(Aug 10 2019 at 15:42)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span> maybe this fixed the issue you mention: <a href="https://bugs.llvm.org/show_bug.cgi?id=31362" target="_blank" title="https://bugs.llvm.org/show_bug.cgi?id=31362">https://bugs.llvm.org/show_bug.cgi?id=31362</a> it specifically covers:</p>
<div class="codehilite"><pre><span></span><span class="n">__attribute__</span><span class="p">((</span><span class="n">ms_abi</span><span class="p">,</span> <span class="n">noinline</span><span class="p">))</span> <span class="n">__int128</span> <span class="n">passthrough_a</span><span class="p">(</span><span class="n">__int128</span> <span class="n">a</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">return</span> <span class="n">a</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>



<a name="172929329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172929329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172929329">(Aug 10 2019 at 15:43)</a>:</h4>
<p>but that was fixed in clang 6.0</p>



<a name="172929347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172929347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172929347">(Aug 10 2019 at 15:43)</a>:</h4>
<p>if you have seen a mismatching ABI since, then it is probably worth filling a bug for that</p>



<a name="172933293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172933293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172933293">(Aug 10 2019 at 17:45)</a>:</h4>
<p>Well the resulting codegen may match gcc now, but both are still incorrect according to the documentation so /me shrugs.</p>



<a name="172933356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172933356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172933356">(Aug 10 2019 at 17:47)</a>:</h4>
<p>I guess your point still stands that if we only intend to ever interoperate with gcc and clang, then we can match their behaviour</p>



<a name="172933540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172933540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172933540">(Aug 10 2019 at 17:52)</a>:</h4>
<p>But we do have explicitly MSVC-compatible targets. And I don't want to end up with an <code>extern "C"</code> ABI break on those targets if MSVC adds __int128 support in a way incompatible with gcc/llvm.</p>



<a name="172933563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172933563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172933563">(Aug 10 2019 at 17:53)</a>:</h4>
<p>There's still other targets without <em>any</em> __int128 support, so we need a way for the FFI-safety of i128 to be target-dependent anyway. The same mechanism should be used to make it not-FFI-safe on the *-msvc targets.</p>



<a name="172934551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172934551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172934551">(Aug 10 2019 at 18:22)</a>:</h4>
<p>The issue with making ffi-safety conditional is that people only ever test their code on x86_64 <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="172934856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172934856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172934856">(Aug 10 2019 at 18:31)</a>:</h4>
<p>I'm not saying it's a great solution, but it's the only possibility if we want to make it ffi-safe at all¯\_(ツ)_/¯</p>



<a name="172943332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172943332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172943332">(Aug 10 2019 at 22:51)</a>:</h4>
<p>I build test on x86/x86_64/wasm32, and also build on arm6t, arm7, and aarch64</p>



<a name="172943334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172943334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172943334">(Aug 10 2019 at 22:51)</a>:</h4>
<p>but I'm not sure that any of that assures that an ABI incompatibility is caught</p>



<a name="172943380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172943380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172943380">(Aug 10 2019 at 22:52)</a>:</h4>
<p>Retep once described ABI mismatch as "a link error, if you're lucky"</p>



<a name="172943621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172943621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172943621">(Aug 10 2019 at 23:02)</a>:</h4>
<p>WindowsBunny forgot to add a few “very” in between of “you’re” and "lucky”.</p>



<a name="172943670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172943670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172943670">(Aug 10 2019 at 23:03)</a>:</h4>
<p>Link error will only happen if you have a function that is defined using calling convention A, and try to refer to it with a declaration that uses calling convention B. And that applies to very limited list of calling convention pairs.</p>



<a name="172964959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172964959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172964959">(Aug 11 2019 at 11:23)</a>:</h4>
<blockquote>
<p>And I don't want to end up with an extern "C" ABI break on those targets if MSVC adds __int128 support in a way incompatible with gcc/llvm.</p>
</blockquote>
<p><span class="user-mention" data-user-id="124289">@rkruppe</span> why not? I think this is fine.</p>



<a name="172965001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965001">(Aug 11 2019 at 11:24)</a>:</h4>
<p>No existing code would break, because there is no existing code interfacing with MSVC code, because that can't be done.</p>



<a name="172965005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965005">(Aug 11 2019 at 11:24)</a>:</h4>
<p>Once gcc &amp; clang update to match that ABI, we can do the same, offering some kind of backward compat flag, if that turns out to be necessary.</p>



<a name="172965017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965017">(Aug 11 2019 at 11:25)</a>:</h4>
<p>Chances are, MSVC will never support <code>__int128</code>, and if they do, they could do so in a way that is compatible with all other code on their platform that's already using <code>__int128</code>.</p>



<a name="172965058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965058">(Aug 11 2019 at 11:26)</a>:</h4>
<p>If they decide not to do that, then well, that's actually no difference at all than when they decide to break their ABI on every new MSVC release anyways.</p>



<a name="172965063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965063">(Aug 11 2019 at 11:26)</a>:</h4>
<p>It's not true no existing code would break, e.g. every Rust project using cdylib with a C ABI interface (as we recommend for plugin-like usage) would be affected by the ABI break</p>



<a name="172965070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965070">(Aug 11 2019 at 11:27)</a>:</h4>
<p>How ? That code is not interfacing with MSVC compiled code.</p>



<a name="172965072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965072">(Aug 11 2019 at 11:27)</a>:</h4>
<p>That code only breaks when we upgrade our ABI</p>



<a name="172965074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965074">(Aug 11 2019 at 11:27)</a>:</h4>
<p>and we can offer a backward compatibility flag to choose an ABI, like all other compilers do on ABI changes</p>



<a name="172965076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965076">(Aug 11 2019 at 11:28)</a>:</h4>
<p>The ABI break we're talking about is <em>us</em> changing <em>our</em> implementation of extern "C" on msvc compatible targets to be actually msvc compatible</p>



<a name="172965077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965077">(Aug 11 2019 at 11:28)</a>:</h4>
<p><code>-C abi-compat=1.X.Y</code></p>



<a name="172965120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965120">(Aug 11 2019 at 11:28)</a>:</h4>
<p>Sure. If MSVC changes their ABI, we have to do a backward breaking change</p>



<a name="172965121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965121">(Aug 11 2019 at 11:28)</a>:</h4>
<p>This is always a shitty solution and I would MUCH rather avoid the ABI break to begin with</p>



<a name="172965123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965123">(Aug 11 2019 at 11:28)</a>:</h4>
<p>currently, we do this things all the time</p>



<a name="172965125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965125">(Aug 11 2019 at 11:28)</a>:</h4>
<p>without a flag</p>



<a name="172965126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965126">(Aug 11 2019 at 11:28)</a>:</h4>
<p>C ABI breaks are very rare and always cause a lot of pain</p>



<a name="172965127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965127">(Aug 11 2019 at 11:28)</a>:</h4>
<p>because we can't support different versions of a platform</p>



<a name="172965129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965129">(Aug 11 2019 at 11:28)</a>:</h4>
<p>clang and gcc also do this on pretty much every release</p>



<a name="172965134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965134">(Aug 11 2019 at 11:29)</a>:</h4>
<p>Nonsense</p>



<a name="172965136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965136">(Aug 11 2019 at 11:29)</a>:</h4>
<p>C++ Abis change, the rust abi changes, but C ABI changes are exceedingly rare</p>



<a name="172965179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965179">(Aug 11 2019 at 11:30)</a>:</h4>
<p><a href="https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fclang-abi-compat" target="_blank" title="https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fclang-abi-compat">https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fclang-abi-compat</a></p>



<a name="172965185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965185">(Aug 11 2019 at 11:30)</a>:</h4>
<p>they do happen for C as well</p>



<a name="172965191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965191">(Aug 11 2019 at 11:30)</a>:</h4>
<p>Yes but extremely rarely and usually only for obscure corner cases or bug fixes</p>



<a name="172965192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965192">(Aug 11 2019 at 11:30)</a>:</h4>
<p>sure</p>



<a name="172965202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965202">(Aug 11 2019 at 11:31)</a>:</h4>
<p>the MSVC ABI has a bug, because compilers for the target use a <code>__int128</code> type, yet the ABI  spec does not document it</p>



<a name="172965203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965203">(Aug 11 2019 at 11:31)</a>:</h4>
<p>that would be a bug fix</p>



<a name="172965244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965244">(Aug 11 2019 at 11:32)</a>:</h4>
<p>ABI specs aren't a document that compilers implement, ABI specs are a document that attempt to document what some compiler on a platform does, so that other compilers can work with it</p>



<a name="172965251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965251">(Aug 11 2019 at 11:32)</a>:</h4>
<p>C ABI breaks are done when you ended up in a shitty situation by accident, not something to willingly walk into as "fine"</p>



<a name="172965252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965252">(Aug 11 2019 at 11:32)</a>:</h4>
<p>clang and gcc on the target do the sane thing</p>



<a name="172965255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965255">(Aug 11 2019 at 11:33)</a>:</h4>
<p>msvc doesn't support the use case at all, doing what clang and gcc do is fine</p>



<a name="172965262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965262">(Aug 11 2019 at 11:33)</a>:</h4>
<p>that's the only ABI that exist for <code>__int128</code> on the target</p>



<a name="172965265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965265">(Aug 11 2019 at 11:33)</a>:</h4>
<p>Microsoft documenting and implementing a different ABI for it would be doing the shitty thing</p>



<a name="172965269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965269">(Aug 11 2019 at 11:33)</a>:</h4>
<p>is their target, if they want to break it, then we can't do anything about that</p>



<a name="172965273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965273">(Aug 11 2019 at 11:33)</a>:</h4>
<p>clang and gcc would need a breaking change there as well, such is life</p>



<a name="172965314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965314">(Aug 11 2019 at 11:34)</a>:</h4>
<p>That is a good point I guess</p>



<a name="172965325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965325">(Aug 11 2019 at 11:34)</a>:</h4>
<p>its an unfortunate situation to be in, we should open a microsoft bug, and instead of asking for msvc to implement __int128, just ask them to document the ABI of the type</p>



<a name="172965338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965338">(Aug 11 2019 at 11:35)</a>:</h4>
<p>if the spec doesn't mention it, the spec has a bug, it doesn't matter that msvc doesn't support it</p>



<a name="172965342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965342">(Aug 11 2019 at 11:35)</a>:</h4>
<p>other compilers for the target do, and they should be able to agree on the ABI</p>



<a name="172965343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965343">(Aug 11 2019 at 11:35)</a>:</h4>
<p>all other sane ABI documents for 64-bit targets document this as well</p>



<a name="172965344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965344">(Aug 11 2019 at 11:36)</a>:</h4>
<p>But backtracking a little, why do we want i128 ffi safety on the msvc targets anyway when it can't be used with msvc code? Why not treat the windows-msvc triples as not having __int128 (which is mostly true)? Does any user ask for compatibility with gcc/clang ms_abi compatibility for this type?</p>



<a name="172965435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965435">(Aug 11 2019 at 11:38)</a>:</h4>
<blockquote>
<p>But backtracking a little, why do we want i128 ffi safety on the msvc targets anyway when it can't be used with msvc code?</p>
</blockquote>
<p>To use it with clang or gcc.</p>



<a name="172965442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965442">(Aug 11 2019 at 11:39)</a>:</h4>
<p>you can use clang via clang-cl.exe to compile for msvc targets, and you can use <code>__int128</code> there</p>



<a name="172965454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965454">(Aug 11 2019 at 11:39)</a>:</h4>
<p>Also, to use it with other Rust code that uses <code>i128</code>, like plugins, dlls, etc.</p>



<a name="172965457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965457">(Aug 11 2019 at 11:39)</a>:</h4>
<p>I know that is possible. But does anyone ask for that?</p>



<a name="172965501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965501">(Aug 11 2019 at 11:40)</a>:</h4>
<p>For that target specifically</p>



<a name="172965502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965502">(Aug 11 2019 at 11:40)</a>:</h4>
<p>Most bugs are about "why can't i use <code>i128</code> on FFI", we haven't surveyed what people wanted to do with it</p>



<a name="172965515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965515">(Aug 11 2019 at 11:41)</a>:</h4>
<p>There are obviously no libraries compiled with <code>msvc</code> that use <code>i128</code></p>



<a name="172965531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965531">(Aug 11 2019 at 11:41)</a>:</h4>
<p>but it is trivial to use gcc or clang from visual studio nowadays, and a lot of people prefer that, so I wouldn't assume anything without doing a survey of usecases</p>



<a name="172965573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965573">(Aug 11 2019 at 11:42)</a>:</h4>
<p>Right but there will always be many targets where i128 can't be ffi safe because there's no C ABI for it in any compiler for the platform, so "I want to use i128 in cross platform rust-rust C-ABI communication" can't be supported anyway</p>



<a name="172965576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965576">(Aug 11 2019 at 11:42)</a>:</h4>
<p>i128 in ffi is unfortunately going to be a platform specific affair</p>



<a name="172965580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965580">(Aug 11 2019 at 11:42)</a>:</h4>
<p>For me, personally, I think that "FFI-safety" means we provide the type an ABI that can be used to interface with other C code compiled for the platform</p>



<a name="172965589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965589">(Aug 11 2019 at 11:43)</a>:</h4>
<p>that doesn't mean that all compilers for a platform support everything, or that they support the same thing in the same way</p>



<a name="172965592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965592">(Aug 11 2019 at 11:43)</a>:</h4>
<p>it just means that it is possible to write code that relies on the ABI of the type</p>



<a name="172965638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965638">(Aug 11 2019 at 11:44)</a>:</h4>
<p>if you are writing msvc code that needs to interface with rust i128, you might be able to match its ABI by using a <code>struct __int128 { int64_ hi, lo; };</code> to interface with it.</p>



<a name="172965640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965640">(Aug 11 2019 at 11:44)</a>:</h4>
<p>If multiple compilers implement the corresponding C type differently, we have a problem in that we need to pick which one we're compatible with. Which may mean refusing to choose, as we do so far re: the interaction of repr(align) and repr(packed)</p>



<a name="172965648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965648">(Aug 11 2019 at 11:44)</a>:</h4>
<p>yep, there we have multiple compilers doing it all in different ways</p>



<a name="172965661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965661">(Aug 11 2019 at 11:45)</a>:</h4>
<p>IIRC msvc supports it, gcc does something different, and clang does what gcc does</p>



<a name="172965663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965663">(Aug 11 2019 at 11:45)</a>:</h4>
<p>that's imo a gcc and clang bug that should be fixed</p>



<a name="172965667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965667">(Aug 11 2019 at 11:45)</a>:</h4>
<p>i don't know if we actually opened the bugs</p>



<a name="172965668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965668">(Aug 11 2019 at 11:45)</a>:</h4>
<p>And that's also a risk that we'll end up in that situation with __int128</p>



<a name="172965675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965675">(Aug 11 2019 at 11:46)</a>:</h4>
<p>the situation is slightly different as argued above</p>



<a name="172965715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965715">(Aug 11 2019 at 11:46)</a>:</h4>
<p>But if we rush ahead now and claim i128 is ffi safe on that platform we won't have the option of refusing to choose</p>



<a name="172965720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965720">(Aug 11 2019 at 11:46)</a>:</h4>
<p>if we want to make <code>i128</code> ffi-safe on the platform, we only have one option, as opposed to 2</p>



<a name="172965724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965724">(Aug 11 2019 at 11:46)</a>:</h4>
<p>for all we know, microsoft might never support it, so it might never be an issue</p>



<a name="172965734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965734">(Aug 11 2019 at 11:47)</a>:</h4>
<p>we can open a microsoft documentation bug for their abi</p>



<a name="172965737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965737">(Aug 11 2019 at 11:47)</a>:</h4>
<p>they support clang-cl, and clang-cl supports <code>__in128</code></p>



<a name="172965740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965740">(Aug 11 2019 at 11:47)</a>:</h4>
<p>Once again I am talking about the <em>possibility</em> that msvc adds support incompatible with gcc</p>



<a name="172965746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965746">(Aug 11 2019 at 11:47)</a>:</h4>
<p>sure, that's a posibility</p>



<a name="172965748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965748">(Aug 11 2019 at 11:47)</a>:</h4>
<p>we can provide a <code>x86_64-pc-windows-msvc2020</code> target for that posibility</p>



<a name="172965788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965788">(Aug 11 2019 at 11:48)</a>:</h4>
<p>or a flag, or nothing</p>



<a name="172965792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965792">(Aug 11 2019 at 11:48)</a>:</h4>
<p>I'm repeating myself but that would really fucking suck!!</p>



<a name="172965794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965794">(Aug 11 2019 at 11:48)</a>:</h4>
<p>Let's please not risk that</p>



<a name="172965798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965798">(Aug 11 2019 at 11:48)</a>:</h4>
<p>with my libc maintainer hat on, all platforms break their ABI all the time</p>



<a name="172965799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965799">(Aug 11 2019 at 11:48)</a>:</h4>
<p>we just do nothing and hope for the best</p>



<a name="172965806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965806">(Aug 11 2019 at 11:49)</a>:</h4>
<p>is that bad? sure, the right solution is platform ABI versioning</p>



<a name="172965807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965807">(Aug 11 2019 at 11:49)</a>:</h4>
<p>And it's bad enough every time, so let's not risk even more breaks</p>



<a name="172965820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965820">(Aug 11 2019 at 11:49)</a>:</h4>
<p>we can not provide FFI-safety for the type for windows msvc targets</p>



<a name="172965824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965824">(Aug 11 2019 at 11:49)</a>:</h4>
<p>but that has its downsides too</p>



<a name="172965874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965874">(Aug 11 2019 at 11:50)</a>:</h4>
<p>Once again let's check if any living person is actually affected by those hypothetical downsides</p>



<a name="172965877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965877">(Aug 11 2019 at 11:50)</a>:</h4>
<p>Every person reading its docs would need to read the line "<strong>warning</strong>: this type is not FFI safe for targets x,y,z,w,"</p>



<a name="172965888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965888">(Aug 11 2019 at 11:51)</a>:</h4>
<p>We need that <em>anyway</em>, we're just talking about adding one more entry to that list</p>



<a name="172965891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965891">(Aug 11 2019 at 11:51)</a>:</h4>
<p>i would provide FFI safety for all targets</p>



<a name="172965893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965893">(Aug 11 2019 at 11:51)</a>:</h4>
<p>i128 can't reasonably be ffi safe on most (all?) 32 bit targets</p>



<a name="172965895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965895">(Aug 11 2019 at 11:51)</a>:</h4>
<p>including 32-bit targets</p>



<a name="172965899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965899">(Aug 11 2019 at 11:51)</a>:</h4>
<p>Even by your definition above</p>



<a name="172965941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965941">(Aug 11 2019 at 11:52)</a>:</h4>
<p>no C compiler for the target supports it, so we can do whatever we want</p>



<a name="172965945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965945">(Aug 11 2019 at 11:52)</a>:</h4>
<p>if a C compiler wants to allow it, we can ask them to be compatible with what we are already doing</p>



<a name="172965949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965949">(Aug 11 2019 at 11:52)</a>:</h4>
<p>if we start doing it, we can just add what we are doing to the 32-bit abi specs of the platforms</p>



<a name="172965952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965952">(Aug 11 2019 at 11:53)</a>:</h4>
<p>FFI safety = improper_ctypes = a lint to prevent people from shooting themselves in the foot with C level interop</p>



<a name="172965957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965957">(Aug 11 2019 at 11:53)</a>:</h4>
<p>It's not a catch all for things whose ABI rustc guarantees!</p>



<a name="172965960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965960">(Aug 11 2019 at 11:53)</a>:</h4>
<p>We may want that too but it's different</p>



<a name="172965961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965961">(Aug 11 2019 at 11:53)</a>:</h4>
<p>then the lint should only apply to <code>extern "C"</code></p>



<a name="172965965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172965965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172965965">(Aug 11 2019 at 11:53)</a>:</h4>
<p>but it currently applies to all <code>extern _</code>s</p>



<a name="172966008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966008">(Aug 11 2019 at 11:54)</a>:</h4>
<p>I don't see your point</p>



<a name="172966015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966015">(Aug 11 2019 at 11:54)</a>:</h4>
<p>All the stable ABIs the lint applies to are C ABIs</p>



<a name="172966029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966029">(Aug 11 2019 at 11:55)</a>:</h4>
<p>In any case all the people who've filed bugs asking why i128 is not ffi safe were using it with extern "C"</p>



<a name="172966077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966077">(Aug 11 2019 at 11:56)</a>:</h4>
<p><a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=315d5078916980d2389e8c317983f4e4" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=315d5078916980d2389e8c317983f4e4">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=315d5078916980d2389e8c317983f4e4</a></p>



<a name="172966085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966085">(Aug 11 2019 at 11:56)</a>:</h4>
<p>lol</p>



<a name="172966093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966093">(Aug 11 2019 at 11:57)</a>:</h4>
<p>I've never used an <code>extern "ABI"</code> for which the improper_ctypes lint has not triggered, ever</p>



<a name="172966099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966099">(Aug 11 2019 at 11:57)</a>:</h4>
<p>anyways, this is another discussion</p>



<a name="172966103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966103">(Aug 11 2019 at 11:57)</a>:</h4>
<p>extern "Rust" blocks are practically impossible to use safely anyway</p>



<a name="172966136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966136">(Aug 11 2019 at 11:58)</a>:</h4>
<p>I think that if an ABI spec does not mention a type, and its a primitive type that's reasonable to use on FFI, like a 128-bit integer, and no compilers on the target support it, we can ask the ABI spec to define an ABI for the type, and implement it</p>



<a name="172966156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966156">(Aug 11 2019 at 11:58)</a>:</h4>
<p>for 32-bit linux that's as easy as sending a PR to the spec and starting a discussion about the semantics</p>



<a name="172966168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966168">(Aug 11 2019 at 11:59)</a>:</h4>
<p>even if C doesn't have a type, it should be possible to write a C struct that interfaces with the type</p>



<a name="172966170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966170">(Aug 11 2019 at 11:59)</a>:</h4>
<p>we have done this for things like <code>repr(C)</code> enums</p>



<a name="172966172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966172">(Aug 11 2019 at 11:59)</a>:</h4>
<p>where C doesn't have enums</p>



<a name="172966177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966177">(Aug 11 2019 at 11:59)</a>:</h4>
<p>You're welcome to ask ABI authors who mostly only care about C to add non-C feature but I am not holding my breath for it to happen everywhere</p>



<a name="172966232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966232">(Aug 11 2019 at 12:00)</a>:</h4>
<blockquote>
<p>even if C doesn't have a type, it should be possible to write a C struct that interfaces with the type</p>
</blockquote>
<p>This is not always obviously possible depending on how you defined the i128 ABI and what the ABI for aggregates looks like</p>



<a name="172966253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966253">(Aug 11 2019 at 12:01)</a>:</h4>
<p>why not? if the abi doesn't have an ABI for <code>__int128</code>, we can define our <code>i128</code> as some C struct, allowing this</p>



<a name="172966267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966267">(Aug 11 2019 at 12:02)</a>:</h4>
<p>Sure you can define the ABI of i128 accordingly but you have to explicitly take care to ensure it</p>



<a name="172966293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966293">(Aug 11 2019 at 12:02)</a>:</h4>
<p>In any case</p>



<a name="172966307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966307">(Aug 11 2019 at 12:03)</a>:</h4>
<p>This idea (lobbying all ABI specs) is a huge amount of work and won't get us coverage of all platforms any time soon (if ever) so IMO the only sensible thing is to either make peace with platform dependent ffi safety or not make it ffi safe anywhere</p>



<a name="172966503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966503">(Aug 11 2019 at 12:09)</a>:</h4>
<p>By the way: if we go with "ffi safe on a subset of platforms" then a great way to find out if anyone needs it to be ffi safe on 64b msvc is to not include it in the list at first and wait for an issue requesting it. Then we can make a much more informed decision than right now.</p>



<a name="172966868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966868">(Aug 11 2019 at 12:20)</a>:</h4>
<p>that's a good point</p>



<a name="172966949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966949">(Aug 11 2019 at 12:23)</a>:</h4>
<p>The lobbying idea is an active way to make sure it works everywhere</p>



<a name="172966990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966990">(Aug 11 2019 at 12:24)</a>:</h4>
<p>but at the end of the day is up to the platform to decide what to do</p>



<a name="172966993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172966993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172966993">(Aug 11 2019 at 12:24)</a>:</h4>
<p>we can have the warning for <code>i128</code> say that the platform abi doesn't specify what to do, and document what Rust does</p>



<a name="172967001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172967001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172967001">(Aug 11 2019 at 12:25)</a>:</h4>
<p>on windows that would be doing what clang and gcc do</p>



<a name="172967007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172967007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172967007">(Aug 11 2019 at 12:25)</a>:</h4>
<p>that is, the warning is orthogonal to the implementation that we provide</p>



<a name="172967048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172967048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172967048">(Aug 11 2019 at 12:26)</a>:</h4>
<p>we can warn that the abi we provide for the type isn't stable, but implement the type in a sane and documented way</p>



<a name="172967899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172967899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172967899">(Aug 11 2019 at 12:53)</a>:</h4>
<p>This is RFC material.</p>



<a name="172967907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172967907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172967907">(Aug 11 2019 at 12:53)</a>:</h4>
<p>Just sayin'.</p>



<a name="172967911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/__int128/near/172967911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/__int128.html#172967911">(Aug 11 2019 at 12:53)</a>:</h4>
<p>The fact that you have a 100 comment back and forth shoul’ve made it pretty obvious.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>